﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using ScreensInterfaces;

namespace ScreensRepo
{
    /// <summary>
    /// Interaction logic for ShowTwoChoicesScreen.xaml
    /// </summary>
    public partial class ShowTwoChoicesScreen : ScreenBase
    {
        public ShowTwoChoicesScreen()
        {
            InitializeComponent();
        }

        private void Right_Button_Click(object sender, RoutedEventArgs e)
        {
            DispatchUserMadeChoice(context.Choices[1]);
        }

        private void Left_Button_Click(object sender, RoutedEventArgs e)
        {
            DispatchUserMadeChoice(context.Choices[0]);
        }

        private void Back_Button_Click(object sender, RoutedEventArgs e)
        {
            RaiseUserClickedBackEvent();
        }

        private void DispatchUserMadeChoice(ScreenChoice choice)
        {   
            UserInputReadyEventArgs eventargs = new UserInputReadyEventArgs();
            eventargs.ScreenOutput.Choice = choice;
            RaiseUserInputReadyEvent(eventargs);
        }
    }
}
